using System; 
using System.Text; 
using System.Data;
using System.Data.SqlClient;
using System.Data.Common;
using System.Collections;
using System.Collections.Generic;
using System.ComponentModel;
using System.Configuration; 
using System.Xml; 
using System.Xml.Serialization;
using SubSonic; 
using SubSonic.Utilities;
namespace DataAccess
{
	#region Tables Struct
	public partial struct Tables
	{
		
		public static string AspnetApplication = @"aspnet_Applications";
        
		public static string AspnetMembership = @"aspnet_Membership";
        
		public static string AspnetPath = @"aspnet_Paths";
        
		public static string AspnetPersonalizationAllUser = @"aspnet_PersonalizationAllUsers";
        
		public static string AspnetPersonalizationPerUser = @"aspnet_PersonalizationPerUser";
        
		public static string AspnetProfile = @"aspnet_Profile";
        
		public static string AspnetRole = @"aspnet_Roles";
        
		public static string AspnetSchemaVersion = @"aspnet_SchemaVersions";
        
		public static string AspnetUser = @"aspnet_Users";
        
		public static string AspnetUsersInRole = @"aspnet_UsersInRoles";
        
		public static string AspnetWebEventEvent = @"aspnet_WebEvent_Events";
        
		public static string ASPStateTempApplication = @"ASPStateTempApplications";
        
		public static string ASPStateTempSession = @"ASPStateTempSessions";
        
		public static string TblAnswer = @"TblAnswers";
        
		public static string TblBakhsh = @"TblBakhsh";
        
		public static string TblCity = @"TblCity";
        
		public static string TblContract = @"TblContract";
        
		public static string TblDehestan = @"TblDehestan";
        
		public static string TblDocument = @"TblDocuments";
        
		public static string TblFile = @"TblFiles";
        
		public static string TblNotification = @"TblNotification";
        
		public static string TblOstan = @"TblOstan";
        
		public static string TblQuestion = @"TblQuestions";
        
		public static string TblStepsAdvisor = @"TblStepsAdvisor";
        
		public static string TblStepsSurveyor = @"TblStepsSurveyor";
        
		public static string TblTask = @"TblTasks";
        
		public static string TblUserDetail = @"TblUserDetail";
        
		public static string TblVillage = @"TblVillage";
        
	}
	#endregion
    #region Schemas
    public partial class Schemas {
		
		public static TableSchema.Table AspnetApplication{
            get { return DataService.GetSchema("aspnet_Applications","mainConnection"); }
		}
        
		public static TableSchema.Table AspnetMembership{
            get { return DataService.GetSchema("aspnet_Membership","mainConnection"); }
		}
        
		public static TableSchema.Table AspnetPath{
            get { return DataService.GetSchema("aspnet_Paths","mainConnection"); }
		}
        
		public static TableSchema.Table AspnetPersonalizationAllUser{
            get { return DataService.GetSchema("aspnet_PersonalizationAllUsers","mainConnection"); }
		}
        
		public static TableSchema.Table AspnetPersonalizationPerUser{
            get { return DataService.GetSchema("aspnet_PersonalizationPerUser","mainConnection"); }
		}
        
		public static TableSchema.Table AspnetProfile{
            get { return DataService.GetSchema("aspnet_Profile","mainConnection"); }
		}
        
		public static TableSchema.Table AspnetRole{
            get { return DataService.GetSchema("aspnet_Roles","mainConnection"); }
		}
        
		public static TableSchema.Table AspnetSchemaVersion{
            get { return DataService.GetSchema("aspnet_SchemaVersions","mainConnection"); }
		}
        
		public static TableSchema.Table AspnetUser{
            get { return DataService.GetSchema("aspnet_Users","mainConnection"); }
		}
        
		public static TableSchema.Table AspnetUsersInRole{
            get { return DataService.GetSchema("aspnet_UsersInRoles","mainConnection"); }
		}
        
		public static TableSchema.Table AspnetWebEventEvent{
            get { return DataService.GetSchema("aspnet_WebEvent_Events","mainConnection"); }
		}
        
		public static TableSchema.Table ASPStateTempApplication{
            get { return DataService.GetSchema("ASPStateTempApplications","mainConnection"); }
		}
        
		public static TableSchema.Table ASPStateTempSession{
            get { return DataService.GetSchema("ASPStateTempSessions","mainConnection"); }
		}
        
		public static TableSchema.Table TblAnswer{
            get { return DataService.GetSchema("TblAnswers","mainConnection"); }
		}
        
		public static TableSchema.Table TblBakhsh{
            get { return DataService.GetSchema("TblBakhsh","mainConnection"); }
		}
        
		public static TableSchema.Table TblCity{
            get { return DataService.GetSchema("TblCity","mainConnection"); }
		}
        
		public static TableSchema.Table TblContract{
            get { return DataService.GetSchema("TblContract","mainConnection"); }
		}
        
		public static TableSchema.Table TblDehestan{
            get { return DataService.GetSchema("TblDehestan","mainConnection"); }
		}
        
		public static TableSchema.Table TblDocument{
            get { return DataService.GetSchema("TblDocuments","mainConnection"); }
		}
        
		public static TableSchema.Table TblFile{
            get { return DataService.GetSchema("TblFiles","mainConnection"); }
		}
        
		public static TableSchema.Table TblNotification{
            get { return DataService.GetSchema("TblNotification","mainConnection"); }
		}
        
		public static TableSchema.Table TblOstan{
            get { return DataService.GetSchema("TblOstan","mainConnection"); }
		}
        
		public static TableSchema.Table TblQuestion{
            get { return DataService.GetSchema("TblQuestions","mainConnection"); }
		}
        
		public static TableSchema.Table TblStepsAdvisor{
            get { return DataService.GetSchema("TblStepsAdvisor","mainConnection"); }
		}
        
		public static TableSchema.Table TblStepsSurveyor{
            get { return DataService.GetSchema("TblStepsSurveyor","mainConnection"); }
		}
        
		public static TableSchema.Table TblTask{
            get { return DataService.GetSchema("TblTasks","mainConnection"); }
		}
        
		public static TableSchema.Table TblUserDetail{
            get { return DataService.GetSchema("TblUserDetail","mainConnection"); }
		}
        
		public static TableSchema.Table TblVillage{
            get { return DataService.GetSchema("TblVillage","mainConnection"); }
		}
        
	
    }
    #endregion
    #region View Struct
    public partial struct Views 
    {
		
		public static string VwAspnetApplication = @"vw_aspnet_Applications";
        
		public static string VwAspnetMembershipUser = @"vw_aspnet_MembershipUsers";
        
		public static string VwAspnetProfile = @"vw_aspnet_Profiles";
        
		public static string VwAspnetRole = @"vw_aspnet_Roles";
        
		public static string VwAspnetUser = @"vw_aspnet_Users";
        
		public static string VwAspnetUsersInRole = @"vw_aspnet_UsersInRoles";
        
		public static string VwAspnetWebPartStatePath = @"vw_aspnet_WebPartState_Paths";
        
		public static string VwAspnetWebPartStateShared = @"vw_aspnet_WebPartState_Shared";
        
		public static string VwAspnetWebPartStateUser = @"vw_aspnet_WebPartState_User";
        
    }
    #endregion
    
    #region Query Factories
	public static partial class DB
	{
        public static DataProvider _provider = DataService.Providers["mainConnection"];
        static ISubSonicRepository _repository;
        public static ISubSonicRepository Repository {
            get {
                if (_repository == null)
                    return new SubSonicRepository(_provider);
                return _repository; 
            }
            set { _repository = value; }
        }
	
        public static Select SelectAllColumnsFrom<T>() where T : RecordBase<T>, new()
	    {
            return Repository.SelectAllColumnsFrom<T>();
            
	    }
	    public static Select Select()
	    {
            return Repository.Select();
	    }
	    
		public static Select Select(params string[] columns)
		{
            return Repository.Select(columns);
        }
	    
		public static Select Select(params Aggregate[] aggregates)
		{
            return Repository.Select(aggregates);
        }
   
	    public static Update Update<T>() where T : RecordBase<T>, new()
	    {
            return Repository.Update<T>();
	    }
     
	    
	    public static Insert Insert()
	    {
            return Repository.Insert();
	    }
	    
	    public static Delete Delete()
	    {
            
            return Repository.Delete();
	    }
	    
	    public static InlineQuery Query()
	    {
            
            return Repository.Query();
	    }
	    	    
	    
	}
    #endregion
    
}
#region Databases
public partial struct Databases 
{
	
	public static string mainConnection = @"mainConnection";
    
}
#endregion